var count = 0;
var results = {};
var done = unction(key, value) {
results[key] = value;
count++;
if (count === 3) {
render(results);
}
};
fs.readFile(template_path, "utf8", function(err, template) {
done("template", template);
});
db.query(sql, function(err, data) {
done("data", data);
});
Synchronous method for retrieving localization strings from app's resources. This function should
be used only when direct manipulation on the strings is needed (etc. date/time formatting) and in
all other UI related cases should be replaced with DOM attributes setting or L10n.setAttributes().
This method has also potential to generate race conditions so a developer has to make sure that any
code that uses this method is not fired before l10n resources are loaded using L10n.once() or L10n.
ready().*/
l10.get(function(err, resources) {
done("resources", resources);
});